import { GET_QUERY_DATE_COMPLETE } from '../actionTypes/query';

const initialState = {
  queryDate: {
    bannerList: [],
  },
};

const actionHandlers = {
  [GET_QUERY_DATE_COMPLETE](state, action) {
    return { ...state, queryDate: action.queryDate };
  },
};

const reducer = (state = initialState, action) => {
  const { type, data } = action;

  const actionHandler = actionHandlers[type];
  if (actionHandler) {
    return actionHandler(state, data);
  }
  return state;
};

export default reducer;
